package com.demo.springcloud.entities.com.demo.springcloud.service;

import com.demo.springcloud.entities.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

//@FeignClient(value = "DEMP-PRODUCER")
@FeignClient(value = "DEMP-PRODUCER", fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

	@RequestMapping(value = "/demo/get/{id}", method = RequestMethod.GET)
	Dept findById(@PathVariable("id") Long id);

	@RequestMapping(value = "/demo/list", method = RequestMethod.GET)
	List<Dept> findDeptList();
}
